{extend name="base_m" /}
{block name="header"}
    <link rel="stylesheet" href="__JS__/layui/css/layui.css" media="all">
{/block}
{block name="body"}
<!--header-->
<div class="header">
    <h1 class="logo">{$site_config.site_name}</h1>
    <span class="icon-grouop"><span class="icon-bookshelf"></span></span>
</div>
<!--wrap-->
<div class="wrap">
    <!--slide-->
    <div class="swiper-container">
        <div class="layui-carousel swiper-wrapper" id="swiper">
            <div carousel-item class="swiper-slide">
                {foreach $site_config.slide_list as $item }
                <a target="{$item.target}" {eq name="$item.url" value=""}href="javascript:void(0)"{else/}href="{$item.url}"{/eq}><img src="{$item.image | down_image}" alt="{$item.name}" /><span>{$item.name}</span></a>
                {/foreach}
            </div>
        </div>
    </div>
    <!-- search -->
    <div class="bar">
        <form method="get" name="search" action="{:url("/search","","","m")}">
            <input type="text" name="k" id="q" placeholder="请输入书名/作者" class="search-key">
            <button type="submit" class="search-btn" id="search-btn">Go</button>
        </form>
    </div>

    <!-- nav -->
    <div class="nav">
        <!--<a href="{:url("/top","","html",true)}"><img class="nav-img" src="__IMAGES__/nav-top.png" alt="排行榜"/><span>排行榜</span></a>-->
        <a href="#"><img class="nav-img" src="__IMAGES__/nav-top.png" alt="排行榜"/><span>排行榜</span></a>
        <a href="{:url("/tags","","html",true)}"><img class="nav-img" src="__IMAGES__/nav-tags.png" alt="标签"/><span>标签</span></a>
        <a href="{:url("/news","","html",true)}"><img class="nav-img" src="__IMAGES__/nav-news.png" alt="资讯"/><span>资讯</span></a>
        <a href="{:url("/classify","","html",true)}"><img class="nav-img" src="__IMAGES__/nav-book.png" alt="小说库"/><span>小说库</span></a>
    </div>

    <!-- rec-book -->
    <div class="mod rec-book">
        <div class="mod-head">
            <h3>编辑推荐</h3>
        </div>
        <div class="book-slide">
            <ul class="clearfix">
                {block_list block_id="1006"}
                {lt name="$index" value="7"}
                <li>
                    <a href="{:url("/book/" . $item['id'],"","html",true)}">
                        <img class="lazy" src="{$item.local_image | down_image}" alt="{$item.title}"/>
                        <span>{$item.title}</span>
                        <em><aria>作者：</aria>{$item.author}</em>
                    </a>
                </li>
                {/lt}
                {/block_list}
            </ul>
        </div>
    </div>
    <!-- /rec-book -->
    <!-- hot-book -->
    <div class="mod hot-book">
        <div class="mod-head">
            <h3>热门小说</h3>
        </div>
        <div class="book-slide">
            <ul class="clearfix">
                {block_list block_id="1006"}
                {lt name="$index" value="8"}
                <li>
                    <a href="{:url("/book/" . $item['id'],"","html",true)}">
                    <img class="lazy" src="{$item.local_image | down_image}" alt="{$item.title}"/>
                    <span>{$item.title}</span>
                    <em><aria>作者：</aria>{$item.author}</em>
                    </a>
                </li>
                {/lt}
                {/block_list}
            </ul>
        </div>
    </div>
    <!-- /hot-book -->
    <!-- new-topic -->
    <div class="mod new-topic">
        <div class="mod-head">
            <h3>最新标签</h3>
            <a href="{:url("/tags","","html",true)}">更多</a>
        </div>
        <div class="tags-list">
            <ul class="clearfix">
                {foreach $hot_tags_list as $key => $item}
                {lt name="$key" value="4"}
                <li>
                    <a href="{:url("/tags/" . $item['id'],"","html",true)}">
                        <img class="lazy" src="{$item.image | down_image}" alt="{$item.title}"/>
                        <span>{$item.title}</span>
                    </a>
                </li>
                {/lt}
                {/foreach}
            </ul>
        </div>
    </div>
    <!-- /new-topic -->
    <!-- new-book -->
    <div class="mod new-book">
        <div class="mod-head">
            <h3>最新小说</h3>
            <a href="{:url("/classify","","html",true)}">更多</a>
        </div>
        <div class="book-list">
            <ul class="clearfix">
                {foreach $home_cid_list as $item}
                <li>
                    <img class="pic lazy" src="{$item.local_image | down_image}" alt="{$item.title}"/>
                    <a class="tit" href="{:url("/book/" . $item['id'],"","html",true)}">{$item.title}</a>
                    <p class="intro">{$item.introduction}</p>
                    <p class="info"><span><aria>作者：</aria>{$item.author}</span><em class="type">{$item.cid | show_cid_name}</em>  {eq name="$item.full" value="1"}<em class="finish">已完结</em>{else/}<em class="serial">连载中</em>{/eq}</p>
                </li>
                {/foreach}
            </ul>
        </div>
    </div>
    <!-- /new-book -->
    <!-- new-news -->
    <div class="mod new-news">
        <div class="mod-head">
            <h3>最新资讯</h3>
            <a href="{:url("/news","","html",true)}">更多</a>
        </div>
        <div class="news-list">
            <ul class="clearfix">
                {foreach $hot_new_list as $item}
                <li><a href="{:url("/news/" . $item['id'],"","html",true)}" target="_blank">{$item.title}</a><span>{$item.create_time | date="Y-m-d"}</span></li>
                {/foreach}
            </ul>
        </div>
    </div>
    <!-- /new-news -->
</div>
{/block}
{block name="footer"}
 <script>
    layui.use(['carousel', 'jquery'], function(){
        var carousel = layui.carousel,
        $ = layui.jquery;

        $(function () {
            carousel.render({
                elem: '#swiper'
                ,width: '100%' //设置容器宽度
                ,height: "10rem"
                ,arrow: 'none' //不显示箭头
                ,anim: 'fade' //切换动画方式
            });
        });
    });
</script>
{/block}